package cn.dzz.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author ArkD42
 * @file SpringCloud-ATGG-2020
 * @create 2020年08月24日 22:47
 */

@Slf4j
@RestController
@RequestMapping("consul/order")
public class ConsulOrderController {

    @Resource
    private RestTemplate restTemplate;

    public static final String PAYMENT_URL = "http://consul-provider-payment-service";

    @RequestMapping("consumer/payment")  // consul/order/consumer/payment
    public String zookeeperPaymentInfo(){
        return restTemplate.getForObject(PAYMENT_URL + "/payment/consul", String.class);
    }

}
